export const options = {
    // 只能选择过去的时间
      disabledDate(time) {
        return  time.getTime() > Date.now();
      },
      shortcuts: [
        {
          text: '今天',
          onClick(picker) {
            console.log(picker);
            const end = new Date()
            const start = new Date()
            picker.$emit('pick', [start, end])
          }
        },    
        {
          text: '昨天',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24)
            end.setTime(end.getTime() - 3600 * 1000 * 24)
            picker.$emit('pick', [start, end])
          }
        },
        {
          text: '过去7天',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
            picker.$emit('pick', [start, end])
          }
        },
        {
          text: '过去30天',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
            picker.$emit('pick', [start, end])
          }
        },
        {
          text: '本周',
          onClick(picker) {
            // 获取当前时间
            var currentDate = new Date()
            // 返回date是一周中的某一天
            var week = currentDate.getDay()
            // 一天的毫秒数
            var millisecond = 1000 * 60 * 60 * 24
            // 减去的天数
            var minusDay = week !== 0 ? week - 1 : 6
            // 本周 周一
            var monday = new Date(
              currentDate.getTime() - minusDay * millisecond
            )
            // 本周 周日
            var sunday = new Date(monday.getTime() + minusDay * millisecond)
            picker.$emit('pick', [monday, sunday])
          }
        },
        {
          text: '上周',
          onClick(picker) {
            // 获取当前时间
            var currentDate = new Date()
            // 返回date是一周中的某一天
            var week = currentDate.getDay()
            // 一天的毫秒数
            var millisecond = 1000 * 60 * 60 * 24
            // 减去的天数
            var minusDay = week !== 0 ? week - 1 : 6
            // 获得当前周的第一天
            var currentWeekDayOne = new Date(
              currentDate.getTime() - millisecond * minusDay
            )
            // 上周最后一天即本周开始的前一天
            var priorWeekLastDay = new Date(
              currentWeekDayOne.getTime() - millisecond
            )
            // 上周的第一天
            var priorWeekFirstDay = new Date(
              priorWeekLastDay.getTime() - millisecond * 6
            )
            picker.$emit('pick', [priorWeekFirstDay, priorWeekLastDay])
          }
        },
        {
          text: '本月',
          onClick(picker) {
            // 起止日期数组
            // 获取当前时间
            var currentDate = new Date()
            // 获得当前月份0-11
            var currentMonth = currentDate.getMonth()
            // 获得当前年份4位年
            var currentYear = currentDate.getFullYear()
            // 求出本月第一天
            var firstDay = new Date(currentYear, currentMonth, 1)
            picker.$emit('pick', [firstDay, new Date()])
          }
        },
        {
          text: '上月',
          onClick(picker) {
            // 获取当前时间
            var currentDate = new Date()
            // 获得当前月份0-11
            var currentMonth = currentDate.getMonth()
            // 获得当前年份4位年
            var currentYear = currentDate.getFullYear()
            // 获得上一个月的第一天
            var priorMonthFirstDay = this.getPriorMonthFirstDay(
              currentYear,
              currentMonth
            )
            // 获得上一月的最后一天
            var priorMonthLastDay = new Date(
              priorMonthFirstDay.getFullYear(),
              priorMonthFirstDay.getMonth(),
              this.getMonthDays(
                priorMonthFirstDay.getFullYear(),
                priorMonthFirstDay.getMonth()
              )
            )
            picker.$emit('pick', [priorMonthFirstDay, priorMonthLastDay])
          }
        }
      ]
    }
    